import HttpClient from "../../../tools/HttpClient";
export default class DraftApi {
    static httpClient = HttpClient.getInstance();
    static async mbType() {
        try {
            return await DraftApi.httpClient.fetchGet("/draft/mbType");
        }
        catch (e) {
            throw e;
        }
    }
    static async getExportState() {
        try {
            return await DraftApi.httpClient.fetchGet("/draft/exportstate");
        }
        catch (e) {
            throw e;
        }
    }
    static async getImportState() {
        try {
            return await DraftApi.httpClient.fetchGet("/draft/importstate");
        }
        catch (e) {
            throw e;
        }
    }
    static async remove(name) {
        try {
            return await DraftApi.httpClient.fetchPost("/draft/remove", {
                name: name,
            });
        }
        catch (e) {
            throw e;
        }
    }
    static async reName(oldName, newName) {
        try {
            return await DraftApi.httpClient.fetchPost("/draft/rename", {
                old_name: oldName,
                new_name: newName,
            });
        }
        catch (e) {
            throw e;
        }
    }
    static async isExits(name) {
        try {
            return await DraftApi.httpClient.fetchPost("/draft/exists", {
                name: name,
            });
        }
        catch (e) {
            throw e;
        }
    }
    static async export(name, distPath) {
        try {
            return await DraftApi.httpClient.fetchPost("/draft/export", {
                name: name,
                path: distPath,
            });
        }
        catch (e) {
            throw e;
        }
    }
    static async import(distPath) {
        try {
            return await DraftApi.httpClient.fetchPost("/draft/import", {
                filePath: distPath,
            });
        }
        catch (e) {
            throw e;
        }
    }
}
